<!--suppress ALL-->
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改会议申请')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content" th:inline="javascript">
    <form class="form-horizontal m" id="form-application-edit" th:object="${tmdMeetingApplication}">
        <input name="id" th:field="*{id}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label">会议名称:</label>
            <div class="col-sm-8">
                <input name="meetingName" th:field="*{meetingName}" class="form-control" type="text" disabled>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">地点:</label>
            <div class="col-sm-8">
                <input name="addressId" th:field="*{addressName}"  th:value="*{addressId}" class="form-control" type="text" disabled>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">部门:</label>
            <div class="col-sm-8">
                <input name="deptId" th:field="*{deptName}" th:value="*{deptId}" class="form-control" type="text" disabled>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">创建人:</label>
            <div class="col-sm-8">
                <input name="createPerson" th:field="*{createPerson}" class="form-control" type="text" disabled>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">紧急程度：</label>
            <div class="col-sm-8">
                <select name="conferenceExtent" class="form-control m-b" readonly="true" th:with="type=${@dict.getType('tmd_meeting_level')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{level}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">主持人:</label>
            <div class="col-sm-8">
                <input name="hostId" th:field="*{hostName}"  th:value="*{hostId}" class="form-control" type="text" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">联系人:</label>
            <div class="col-sm-8">
                <input name="linkmanId" th:field="*{linkmanName}"  th:value="*{linkmanId}" class="form-control" type="text" readonly>
            </div>
        </div>
<!--        <div class="form-group">-->
<!--            <label class="col-sm-3 control-label">与会人员</label>-->
<!--            <div class="col-sm-8">-->
<!--                <input class="form-control" type="text" name="meetingPerson">-->
<!--            </div>-->
<!--        </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label">与会人员：</label>
            <div class="col-sm-8">
                <select  name="joinStaff" id="joinStaff" class="form-control select2-multiple"  multiple>
                    <th:block th:each="everyuser:${userList}" th:with="joinStaff = ${tmdMeetingApplication.joinStaff}">
                        <option th:value="${everyuser.userId}" th:selected="${#arrays.contains(joinStaff,everyuser.userId.intValue())}" th:text="${everyuser.userName}"></option>
                    </th:block>
                </select>
            </div>
        </div>

<!--        <div class="form-group">-->
<!--            <label class="col-sm-3 control-label">分享人</label>-->
<!--            <div class="col-sm-8">-->
<!--                <input class="form-control" type="text" name="sharedPerson">-->
<!--            </div>-->
<!--        </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label">分享人：</label>
            <div class="col-sm-8">
                <select  name="shareStaff" id="shareStaff" class="form-control select2-multiple" multiple>
                    <th:block th:each="everyuser:${userList}" th:with="shareStaff = ${tmdMeetingApplication.shareStaff}">
                        <option th:value="${everyuser.userId}" th:selected="${#arrays.contains(shareStaff,everyuser.userId.intValue())}" th:text="${everyuser.userName}"></option>
                    </th:block>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">开始时间:</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input name="startTime" th:value="${#dates.format(tmdMeetingApplication.startTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" readonly>
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">结束时间:</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input name="endTime" th:value="${#dates.format(tmdMeetingApplication.endTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" disabled>
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">附件:</label>
            <div class="col-sm-8">
                <input type="hidden" name="file" th:field="*{file}">
                <div class="file-loading">
                    <input class="form-control file-upload" id="file" name="file" type="file" disabled>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">内容:</label>
            <div class="col-sm-8">
                <textarea name="context" class="form-control" disabled>[[*{context}]]</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注:</label>
            <div class="col-sm-8">
                <textarea name="notes" class="form-control" disabled>[[*{notes}]]</textarea>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-fileinput-js"/>
<script th:inline="javascript">
    var prefix = ctx + "list/application";
    $("#form-application-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-application-edit').serialize());
        }
    }

    $("input[name='startTime']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='endTime']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $(".file-upload").each(function (i) {
        var val = $("input[name='" + this.id + "']").val()
        $(this).fileinput({
            'uploadUrl': ctx + 'common/upload',
            initialPreviewAsData: true,
            initialPreview: [val],
            maxFileCount: 1,
            autoReplace: true
        }).on('fileuploaded', function (event, data, previewId, index) {
            $("input[name='" + event.currentTarget.id + "']").val(data.response.url)
        }).on('fileremoved', function (event, id, index) {
            $("input[name='" + event.currentTarget.id + "']").val('')
        })
        $(this).fileinput('_initFileActions');
    });
</script>
</body>
</html>